var obj = {
  name: '1',
  age: 2,
  gender: '1',
  gender1: null,
  gender2: NaN,
  name1: undefined,
  num: new String(0),
  fun: function() {},
  symbol: 1,
  chil: {
    name: '111',
    age: 33,
    gender: '33'
  },
  // toJSON: () => {return 'tttttttt'}
}
let a = {
  name: '1',
  toJSON: () => {return '2'}
}

console.log(JSON.stringify(obj, null, 2))

// console.log(JSON.stringify(obj, ['name', 'age', 'chil'], 3))

// console.log(JSON.stringify(obj, (key, value) => {
//   if (typeof value !== 'string') {
//     return value
//   }
// }))
// console.log(JSON.stringify(obj, null, 2))
// console.log(JSON.stringify(obj))